<?php

namespace api\finance\controller;

class AdminMoneyChargeChannelController extends \Aaa\finance\controller\AdminMoneyChargeChannelController {

    protected function init() {
        $options = [];
        $class = new MoneyChargeController;
        $actions = get_class_methods($class);
        $actions = array_slice($actions, 0, array_search('______', $actions));
        foreach ($actions as $v) {
            $method = new \ReflectionMethod($class, $v);
            $doc = $method->getDocComment();
            preg_match('/@name (.*)\n/', $doc, $matches);
            $name = trim($matches[1]);
            $name or $name = $v;
            $options[] = ['name' => $name, 'value' => $v];
        }
        $this->baseField = [
            [
                'field' => 'id',
                'name' => 'ID',
            ],
            [
                'field' => 'name',
                'name' => '渠道名称',
            ],
            [
                'field' => 'action',
                'name' => '支付渠道',
                'type' => 'select',
                'options' => $options,
                'remark'=>'可在/api/finance/controller/MoneyChargeController.php中添加',
            ],
            [
                'field' => 'icon',
                'name' => '图标',
                'type' => 'icon',
                'options' => [
                    'i-alipay-square-fill',
                    'i-wechat-fill'
                ],
            ],
            [
                'field' => 'icon_color',
                'name' => '图标颜色',
                'type' => 'color',
            ],
            [
                'field' => 'list_order',
                'name' => '排序',
            ],
        ];
    }


}